package com.briup.day12;

import java.util.HashSet;
import java.util.Set;

/**
 * @author lining
 * @date 2024/1/23 14:45
 */
public class TestStudent {
    public static void main(String[] args) {
        //set为什么可以实现不存储重复元素。通过调用equals 和hashcode()方法实现
        Set<Student> students = new HashSet<>();
        students.add(new Student(1,"jack"));
        students.add(new Student(1,"jack"));
        students.add(new Student(1,"jack"));
        students.add(new Student(1,"jack"));
        System.out.println(students);//存储几个学生？
    }
}
